package com.hst.web.sys.web;

import java.io.IOException;
import java.text.ParseException;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.fasterxml.jackson.core.JsonGenerationException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.hst.core.annotation.WebAuth;
import com.hst.web.sys.quartz.DBSyncQuartz;
import com.hst.web.sys.quartz.ExcelExportQuartz;

/**
 * @author duyog
 *
 */
@WebAuth
@Controller
@RequestMapping("/dbSync")
public class DBSyncController {
	static Logger logger = LoggerFactory.getLogger(DBSyncController.class);
	
	@Autowired
	DBSyncQuartz dBSyncQuartz;
	
	@Autowired
	ExcelExportQuartz excelExportQuartz;
	
	@RequestMapping("/dbSync")
	public void dbSync(Model m) throws JsonGenerationException, JsonMappingException, IOException {
		dBSyncQuartz.DBSyncQuartz();
		m.addAttribute("msg","success");
	}

	
	@RequestMapping("/checkPendingDataExp")
	public void checkPendingDataExp(Model m) throws JsonGenerationException, JsonMappingException, IOException, ParseException {
		excelExportQuartz.checkPendingDataExp();
		m.addAttribute("msg","success");
	}	

}
